package persistencia;

import org.hibernate.SQLQuery;

import persistencia.base.GenericDAOAbstract;

import dominio.Cliente;


public class ClienteDAOImpl extends GenericDAOAbstract<Cliente, Long> implements ClienteDAO {

	public Cliente buscarPorNome(String nome) {
//		
//		String hql = "from Pessoa p where p.cpf like :cpf";
//		Query hqlQuery = getSession().createQuery(hql);
//		hqlQuery.setParameter("cpf", cpf);
//		return (Pessoa) hqlQuery.uniqueResult();
		
		
		String sql = "SELECT * FROM cliente c where c.nomerazaosocial like + '" + nome + "'";
		SQLQuery sqlQuery = getSession().createSQLQuery(sql);
		return (Cliente) sqlQuery.uniqueResult();
		
	}

}
